package org.mspring.mlog.web.security.interceptors.handlers;

import java.io.IOException;

import org.springframework.security.web.FilterInvocation;

/**
 * 验证失败后跳转页面
 * 
 * @author Gao Youbo
 * @since 2013年7月12日
 */
public class RedirectFailureHandler extends AbstractFailureHandler {

    /**
     * 要跳转的地址
     */
    private String redirectUrl;

    public String getRedirectUrl() {
        return redirectUrl;
    }

    public void setRedirectUrl(String redirectUrl) {
        this.redirectUrl = redirectUrl;
    }

    @Override
    public void handler(FilterInvocation fi) throws IOException {
        // TODO Auto-generated method stub
        fi.getResponse().sendRedirect(redirectUrl);
    }

}
